const navlink ={
	navBack:()=>{
		// uni.navigateBack()
		let pages = getCurrentPages();
		if(pages.length>1){
			uni.navigateBack();
		}else{
			uni.switchTab({
				url: '/pages/index/index'
			})
		}
	},
	navRed:(url)=>{
		uni.redirectTo({
		    url
		});
	},
	navNew:(url)=>{
		console.log(url)
		uni.navigateToMiniProgram({
		  appId: 'wx4cbf847f4c621150',
		  path: url,
		  extraData: {
		    // 'data1': 'test'
		  },
		  success:res=> {
		    // 打开成功
			console.log('打开小程序成功')
		  },
		  fail:res=>{
		  	console.log('打开小程序失败')
			this.$navTo('/pages/index/index');
		  },
		  complete(res) {
		  	console.log(res)
		  }
		})
	}
}
export default navlink
